package com.example.administrator.basedemos.fragment;

import android.content.Intent;
import android.support.v4.view.ViewPager;
import android.view.View;

import com.example.administrator.basedemos.R;
import com.example.administrator.basedemos.activity.MarketSearchActivity;
import com.example.administrator.basedemos.adapter.MarKetVPAdapter;
import com.example.administrator.basedemos.view.tablayout.TabLayout;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * 创建者     ZCL
 * 创建时间   2018/7/3 17:33
 * 描述	      ${TODO}
 * <p>
 * 更新者     $Author$
 * 更新时间   $Date$
 * 更新描述   ${TODO}
 */
public class MarketFragment extends BaseFragment {
    @BindView(R.id.market_vp)
    ViewPager mMarketVp;
    @BindView(R.id.tab_layout)
    TabLayout mTabLayout;

    private String TAG = "MarketFragment";


    @Override
    public void initData() {
        mMarketVp.setAdapter(new MarKetVPAdapter(getActivity().getSupportFragmentManager()));
        mTabLayout.setupWithViewPager(mMarketVp, true);


    }

    @Override
    public int setLayoutId() {
        return R.layout.fragment_market;
    }

    @OnClick({R.id.market_search, R.id.market_setting})
    public void OnClik(View v) {
        switch (v.getId()) {
            case R.id.market_search:
                Intent intent = new Intent(getActivity(), MarketSearchActivity.class);
                startActivity(intent);
                break;
            case R.id.market_setting:

                break;
        }
    }
}
